PROP_POPUP_SET_WIDTH,
PROP_POPUP_SINGLE_MATCH,
PROP_INLINE_SELECTION,
- PROP_CELL_AREA
+ PROP_CELL_AREA,
+ NUM_PROPERTIES
};
static void disconnect_completion_signals (GtkEntryCompletion *completion);
+static GParamSpec *entry_completion_props[NUM_PROPERTIES] = { NULL, };
+
static guint entry_completion_signals[LAST_SIGNAL] = { 0 };
/* GtkBuildable */
G_TYPE_NONE, 1,
G_TYPE_INT);
- g_object_class_install_property (object_class,
- PROP_MODEL,
- g_param_spec_object ("model",
- P_("Completion Model"),
- P_("The model to find matches in"),
- GTK_TYPE_TREE_MODEL,
- GTK_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_MINIMUM_KEY_LENGTH,
- g_param_spec_int ("minimum-key-length",
- P_("Minimum Key Length"),
- P_("Minimum length of the search key in order to look up matches"),
- 0,
- G_MAXINT,
- 1,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ entry_completion_props[PROP_MODEL] =
+ g_param_spec_object ("model",
+ P_("Completion Model"),
+ P_("The model to find matches in"),
+ GTK_TYPE_TREE_MODEL,
+ GTK_PARAM_READWRITE);
+
+ entry_completion_props[PROP_MINIMUM_KEY_LENGTH] =
+ g_param_spec_int ("minimum-key-length",
+ P_("Minimum Key Length"),
+ P_("Minimum length of the search key in order to look up matches"),
+ 0, G_MAXINT, 1,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
/**
* GtkEntryCompletion:text-column:
*
*
* Since: 2.6
*/
- g_object_class_install_property (object_class,
- PROP_TEXT_COLUMN,
- g_param_spec_int ("text-column",
- P_("Text column"),
- P_("The column of the model containing the strings."),
- -1,
- G_MAXINT,
- -1,
- GTK_PARAM_READWRITE));
+ entry_completion_props[PROP_TEXT_COLUMN] =
+ g_param_spec_int ("text-column",
+ P_("Text column"),
+ P_("The column of the model containing the strings."),
+ -1, G_MAXINT, -1,
+ GTK_PARAM_READWRITE);
/**
* GtkEntryCompletion:inline-completion:
*
* Since: 2.6
**/
- g_object_class_install_property (object_class,
- PROP_INLINE_COMPLETION,
- g_param_spec_boolean ("inline-completion",
- P_("Inline completion"),
- P_("Whether the common prefix should be inserted automatically"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ entry_completion_props[PROP_INLINE_COMPLETION] =
+ g_param_spec_boolean ("inline-completion",
+ P_("Inline completion"),
+ P_("Whether the common prefix should be inserted automatically"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkEntryCompletion:popup-completion:
*
* Since: 2.6
**/
- g_object_class_install_property (object_class,
- PROP_POPUP_COMPLETION,
- g_param_spec_boolean ("popup-completion",
- P_("Popup completion"),
- P_("Whether the completions should be shown in a popup window"),
- TRUE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ entry_completion_props[PROP_POPUP_COMPLETION] =
+ g_param_spec_boolean ("popup-completion",
+ P_("Popup completion"),
+ P_("Whether the completions should be shown in a popup window"),
+ TRUE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkEntryCompletion:popup-set-width:
*
* Since: 2.8
*/
- g_object_class_install_property (object_class,
- PROP_POPUP_SET_WIDTH,
- g_param_spec_boolean ("popup-set-width",
- P_("Popup set width"),
- P_("If TRUE, the popup window will have the same size as the entry"),
- TRUE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ entry_completion_props[PROP_POPUP_SET_WIDTH] =
+ g_param_spec_boolean ("popup-set-width",
+ P_("Popup set width"),
+ P_("If TRUE, the popup window will have the same size as the entry"),
+ TRUE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkEntryCompletion:popup-single-match:
*
* Since: 2.8
*/
- g_object_class_install_property (object_class,
- PROP_POPUP_SINGLE_MATCH,
- g_param_spec_boolean ("popup-single-match",
- P_("Popup single match"),
- P_("If TRUE, the popup window will appear for a single match."),
- TRUE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ entry_completion_props[PROP_POPUP_SINGLE_MATCH] =
+ g_param_spec_boolean ("popup-single-match",
+ P_("Popup single match"),
+ P_("If TRUE, the popup window will appear for a single match."),
+ TRUE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
/**
* GtkEntryCompletion:inline-selection:
*
*
* Since: 2.12
*/
- g_object_class_install_property (object_class,
- PROP_INLINE_SELECTION,
- g_param_spec_boolean ("inline-selection",
- P_("Inline selection"),
- P_("Your description here"),
- FALSE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
+ entry_completion_props[PROP_INLINE_SELECTION] =
+ g_param_spec_boolean ("inline-selection",
+ P_("Inline selection"),
+ P_("Your description here"),
+ FALSE,
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkEntryCompletion:cell-area:
*
* The #GtkCellArea used to layout cell renderers in the treeview column.
*
- * If no area is specified when creating the entry completion with gtk_entry_completion_new_with_area()
- * a horizontally oriented #GtkCellAreaBox will be used.
+ * If no area is specified when creating the entry completion with
+ * gtk_entry_completion_new_with_area() a horizontally oriented
+ * #GtkCellAreaBox will be used.
*
* Since: 3.0
*/
- g_object_class_install_property (object_class,
- PROP_CELL_AREA,
- g_param_spec_object ("cell-area",
- P_("Cell Area"),
- P_("The GtkCellArea used to layout cells"),
- GTK_TYPE_CELL_AREA,
- GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ entry_completion_props[PROP_CELL_AREA] =
+ g_param_spec_object ("cell-area",
+ P_("Cell Area"),
+ P_("The GtkCellArea used to layout cells"),
+ GTK_TYPE_CELL_AREA,
+ GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+
+ g_object_class_install_properties (object_class, NUM_PROPERTIES, entry_completion_props);
}
GTK_TREE_MODEL (completion->priv->filter_model));
g_object_unref (completion->priv->filter_model);
- g_object_notify (G_OBJECT (completion), "model");
+ g_object_notify_by_pspec (G_OBJECT (completion), entry_completion_props[PROP_MODEL]);
if (gtk_widget_get_visible (completion->priv->popup_window))
_gtk_entry_completion_resize_popup (completion);
{
completion->priv->minimum_key_length = length;
- g_object_notify (G_OBJECT (completion), "minimum-key-length");
+ g_object_notify_by_pspec (G_OBJECT (completion),
+ entry_completion_props[PROP_MINIMUM_KEY_LENGTH]);
}
}
cell,
"text", column);
- g_object_notify (G_OBJECT (completion), "text-column");
+ g_object_notify_by_pspec (G_OBJECT (completion), entry_completion_props[PROP_TEXT_COLUMN]);
}
/**
{
completion->priv->inline_completion = inline_completion;
- g_object_notify (G_OBJECT (completion), "inline-completion");
+ g_object_notify_by_pspec (G_OBJECT (completion), entry_completion_props[PROP_INLINE_COMPLETION]);
}
}
{
completion->priv->popup_completion = popup_completion;
- g_object_notify (G_OBJECT (completion), "popup-completion");
+ g_object_notify_by_pspec (G_OBJECT (completion), entry_completion_props[PROP_POPUP_COMPLETION]);
}
}
{
completion->priv->popup_set_width = popup_set_width;
- g_object_notify (G_OBJECT (completion), "popup-set-width");
+ g_object_notify_by_pspec (G_OBJECT (completion), entry_completion_props[PROP_POPUP_SET_WIDTH]);
}
}
{
completion->priv->popup_single_match = popup_single_match;
- g_object_notify (G_OBJECT (completion), "popup-single-match");
+ g_object_notify_by_pspec (G_OBJECT (completion), entry_completion_props[PROP_POPUP_SINGLE_MATCH]);
}
}
{
completion->priv->inline_selection = inline_selection;
- g_object_notify (G_OBJECT (completion), "inline-selection");
+ g_object_notify_by_pspec (G_OBJECT (completion), entry_completion_props[PROP_INLINE_SELECTION]);
}
}